﻿Public Class RCMS_FloorSorter
    Implements System.Collections.Generic.IComparer(Of String)

    Public Function Compare(ByVal x As String, ByVal y As String) As Integer _
                            Implements System.Collections.Generic.IComparer(Of String).Compare
        Dim returnVal As Integer = -1
        Dim s1 As String = x
        If s1 = "TOTAL" Then
            s1 = "01" & s1
        Else
            s1 = s1.PadLeft(3, "0")
            s1 = "02" & s1
        End If
        Dim s2 As String = y
        If s2 = "TOTAL" Then
            s2 = "01" & s2
        Else
            s2 = s2.PadLeft(3, "0")
            s2 = "02" & s2
        End If
        returnVal = [String].Compare(s1, s2)
        Return returnVal
    End Function
End Class
